const E = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
const O = {
  rotl: function (t, e) {
    return t << e | t >>> 32 - e
  },
  rotr: function (t, e) {
    return t << 32 - e | t >>> e
  },
  endian: function (t) {
    if (t.constructor == Number)
      return 16711935 & O.rotl(t, 8) | 4278255360 & O.rotl(t, 24);
    for (var e = 0; e < t.length; e++)
      t[e] = O.endian(t[e]);
    return t
  },
  randomBytes: function (t) {
    for (var e = []; t > 0; t--)
      e.push(Math.floor(256 * Math.random()));
    return e
  },
  bytesToWords: function (t) {
    for (var e = [], n = 0, r = 0; n < t.length; n++,
      r += 8)
      e[r >>> 5] |= t[n] << 24 - r % 32;
    return e
  },
  wordsToBytes: function (t) {
    for (var e = [], n = 0; n < 32 * t.length; n += 8)
      e.push(t[n >>> 5] >>> 24 - n % 32 & 255);
    return e
  },
  bytesToHex: function (t) {
    for (var e = [], n = 0; n < t.length; n++)
      e.push((t[n] >>> 4).toString(16)),
        e.push((15 & t[n]).toString(16));
    return e.join("")
  },
  hexToBytes: function (t) {
    for (var e = [], n = 0; n < t.length; n += 2)
      e.push(parseInt(t.substr(n, 2), 16));
    return e
  },
  bytesToBase64: function (t) {
    for (var e = [], n = 0; n < t.length; n += 3)
      for (var r = t[n] << 16 | t[n + 1] << 8 | t[n + 2], o = 0; o < 4; o++)
        8 * n + 6 * o <= 8 * t.length ? e.push(E.charAt(r >>> 6 * (3 - o) & 63)) : e.push("=");
    return e.join("")
  },
  base64ToBytes: function (t) {
    t = t.replace(/[^A-Z0-9+\/]/gi, "");
    for (var e = [], n = 0, r = 0; n < t.length; r = ++n % 4)
      0 != r && e.push((E.indexOf(t.charAt(n - 1)) & Math.pow(2, -2 * r + 8) - 1) << 2 * r | E.indexOf(t.charAt(n)) >>> 6 - 2 * r);
    return e
  }
}

const T = {
  utf8: {
    stringToBytes: function (t) {
      return T.bin.stringToBytes(unescape(encodeURIComponent(t)))
    },
    bytesToString: function (t) {
      return decodeURIComponent(escape(T.bin.bytesToString(t)))
    }
  },
  bin: {
    stringToBytes: function (t) {
      for (var e = [], n = 0; n < t.length; n++)
        e.push(255 & t.charCodeAt(n));
      return e
    },
    bytesToString: function (t) {
      for (var e = [], n = 0; n < t.length; n++)
        e.push(String.fromCharCode(t[n]));
      return e.join("")
    }
  }
}

function o(i, a) {
  i.constructor == String ? i = a && "binary" === a.encoding ? r.stringToBytes(i) : T.utf8.stringToBytes(i) : n(i) ? i = Array.prototype.slice.call(i, 0) : Array.isArray(i) || i.constructor === Uint8Array || (i = i.toString());
  for (var c = O.bytesToWords(i), u = 8 * i.length, s = 1732584193, l = -271733879, f = -1732584194, p = 271733878, d = 0; d < c.length; d++)
    c[d] = 16711935 & (c[d] << 8 | c[d] >>> 24) | 4278255360 & (c[d] << 24 | c[d] >>> 8);
  c[u >>> 5] |= 128 << u % 32,
    c[14 + (u + 64 >>> 9 << 4)] = u;
  var h = o._ff
    , v = o._gg
    , y = o._hh
    , m = o._ii;
  for (d = 0; d < c.length; d += 16) {
    var g = s
      , b = l
      , w = f
      , A = p;
    s = h(s, l, f, p, c[d + 0], 7, -680876936),
      p = h(p, s, l, f, c[d + 1], 12, -389564586),
      f = h(f, p, s, l, c[d + 2], 17, 606105819),
      l = h(l, f, p, s, c[d + 3], 22, -1044525330),
      s = h(s, l, f, p, c[d + 4], 7, -176418897),
      p = h(p, s, l, f, c[d + 5], 12, 1200080426),
      f = h(f, p, s, l, c[d + 6], 17, -1473231341),
      l = h(l, f, p, s, c[d + 7], 22, -45705983),
      s = h(s, l, f, p, c[d + 8], 7, 1770035416),
      p = h(p, s, l, f, c[d + 9], 12, -1958414417),
      f = h(f, p, s, l, c[d + 10], 17, -42063),
      l = h(l, f, p, s, c[d + 11], 22, -1990404162),
      s = h(s, l, f, p, c[d + 12], 7, 1804603682),
      p = h(p, s, l, f, c[d + 13], 12, -40341101),
      f = h(f, p, s, l, c[d + 14], 17, -1502002290),
      s = v(s, l = h(l, f, p, s, c[d + 15], 22, 1236535329), f, p, c[d + 1], 5, -165796510),
      p = v(p, s, l, f, c[d + 6], 9, -1069501632),
      f = v(f, p, s, l, c[d + 11], 14, 643717713),
      l = v(l, f, p, s, c[d + 0], 20, -373897302),
      s = v(s, l, f, p, c[d + 5], 5, -701558691),
      p = v(p, s, l, f, c[d + 10], 9, 38016083),
      f = v(f, p, s, l, c[d + 15], 14, -660478335),
      l = v(l, f, p, s, c[d + 4], 20, -405537848),
      s = v(s, l, f, p, c[d + 9], 5, 568446438),
      p = v(p, s, l, f, c[d + 14], 9, -1019803690),
      f = v(f, p, s, l, c[d + 3], 14, -187363961),
      l = v(l, f, p, s, c[d + 8], 20, 1163531501),
      s = v(s, l, f, p, c[d + 13], 5, -1444681467),
      p = v(p, s, l, f, c[d + 2], 9, -51403784),
      f = v(f, p, s, l, c[d + 7], 14, 1735328473),
      s = y(s, l = v(l, f, p, s, c[d + 12], 20, -1926607734), f, p, c[d + 5], 4, -378558),
      p = y(p, s, l, f, c[d + 8], 11, -2022574463),
      f = y(f, p, s, l, c[d + 11], 16, 1839030562),
      l = y(l, f, p, s, c[d + 14], 23, -35309556),
      s = y(s, l, f, p, c[d + 1], 4, -1530992060),
      p = y(p, s, l, f, c[d + 4], 11, 1272893353),
      f = y(f, p, s, l, c[d + 7], 16, -155497632),
      l = y(l, f, p, s, c[d + 10], 23, -1094730640),
      s = y(s, l, f, p, c[d + 13], 4, 681279174),
      p = y(p, s, l, f, c[d + 0], 11, -358537222),
      f = y(f, p, s, l, c[d + 3], 16, -722521979),
      l = y(l, f, p, s, c[d + 6], 23, 76029189),
      s = y(s, l, f, p, c[d + 9], 4, -640364487),
      p = y(p, s, l, f, c[d + 12], 11, -421815835),
      f = y(f, p, s, l, c[d + 15], 16, 530742520),
      s = m(s, l = y(l, f, p, s, c[d + 2], 23, -995338651), f, p, c[d + 0], 6, -198630844),
      p = m(p, s, l, f, c[d + 7], 10, 1126891415),
      f = m(f, p, s, l, c[d + 14], 15, -1416354905),
      l = m(l, f, p, s, c[d + 5], 21, -57434055),
      s = m(s, l, f, p, c[d + 12], 6, 1700485571),
      p = m(p, s, l, f, c[d + 3], 10, -1894986606),
      f = m(f, p, s, l, c[d + 10], 15, -1051523),
      l = m(l, f, p, s, c[d + 1], 21, -2054922799),
      s = m(s, l, f, p, c[d + 8], 6, 1873313359),
      p = m(p, s, l, f, c[d + 15], 10, -30611744),
      f = m(f, p, s, l, c[d + 6], 15, -1560198380),
      l = m(l, f, p, s, c[d + 13], 21, 1309151649),
      s = m(s, l, f, p, c[d + 4], 6, -145523070),
      p = m(p, s, l, f, c[d + 11], 10, -1120210379),
      f = m(f, p, s, l, c[d + 2], 15, 718787259),
      l = m(l, f, p, s, c[d + 9], 21, -343485551),
      s = s + g >>> 0,
      l = l + b >>> 0,
      f = f + w >>> 0,
      p = p + A >>> 0
  }
  return O.endian([s, l, f, p])
}

o._ff = function (t, e, n, r, o, i, a) {
  var c = t + (e & n | ~e & r) + (o >>> 0) + a;
  return (c << i | c >>> 32 - i) + e
}
o._gg = function (t, e, n, r, o, i, a) {
  var c = t + (e & r | n & ~r) + (o >>> 0) + a;
  return (c << i | c >>> 32 - i) + e
}
o._hh = function (t, e, n, r, o, i, a) {
  var c = t + (e ^ n ^ r) + (o >>> 0) + a;
  return (c << i | c >>> 32 - i) + e
}
o._ii = function (t, e, n, r, o, i, a) {
  var c = t + (n ^ (e | ~r)) + (o >>> 0) + a;
  return (c << i | c >>> 32 - i) + e
}

function I(e) {
  var i = O.wordsToBytes(o(e, undefined));
  return O.bytesToHex(i)
}

function getRid(i, a, t) {
  if (i && a) {
    for (var c = (n = i + a,
      r = [],
      [46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49, 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40, 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57, 62, 11, 36, 20, 34, 44, 52].forEach((function (t) {
        n.charAt(t) && r.push(n.charAt(t))
      }
      )),
      r.join("").slice(0, 32)),
      u = Math.round(Date.now() / 1e3), s = Object.assign({}, t, {
        wts: u
      }), l = Object.keys(s).sort(), f = [], p = /[!'()*]/g, d = 0; d < l.length; d++) {
      var h = l[d]
        , v = s[h];
      v && "string" == typeof v && (v = v.replace(p, "")),
        null != v && f.push("".concat(encodeURIComponent(h), "=").concat(encodeURIComponent(v)))
    }
    var y = f.join("&");
    return {
      w_rid: I(y + c),
      wts: u.toString()
    }
  }
}

function F() {
  return [
    "eYXsC",
    "timeToStar",
    "stringify",
    "euaoO",
    "Chsgm",
    "querySelec",
    "userIntera",
    "FpgEP",
    "from",
    "YBTGe",
    "uMOSh",
    "logStackMa",
    "logStack",
    "gMMIT",
    "XSeVu",
    "mUaor",
    "XMLTc",
    "CBtcS",
    "FBNCW",
    "queryUserL",
    "height",
    "wsvTV",
    "ESdsi",
    "DJNSA",
    "TspyF",
    "eFqss",
    "nUASn",
    "BIWVQ",
    "ZjkDu",
    "Bhokg",
    "ed in SSR",
    "map",
    "tZwXZ",
    "zEBNC",
    "xzVNF",
    "vHDCK",
    "uCHRI",
    "mDYpc",
    "nGGLU",
    "tagName",
    "lAtfa",
    "DDrIb",
    "pZAJD",
    "LLsrF",
    "stop",
    "wheel",
    "ynfbw",
    "tector",
    "264gTTKIx",
    "jeOhK",
    "SbWjf",
    "YqkAT",
    "SxIgJ",
    "gwbjC",
    "rJmpm",
    "XaYek",
    "fpyYK",
    "bTgCP",
    "touchmove",
    "EFbOS",
    "uKQxh",
    "paygT",
    "NNSOA",
    "WynLv",
    "20OupxAP",
    "oyBGj",
    "yAJxi",
    "as a funct",
    "target",
    "uHDBR",
    "glInfo",
    "KDBVx",
    "12HjGQCI",
    "hLJxt",
    "NAplI",
    "iterator",
    "function",
    "yCSZy",
    "ent",
    "hWjIU",
    "EDhkQ",
    "ggHTv",
    "random",
    "fSPLs",
    "NtwaA",
    "gClientRec",
    "amnUg",
    "state",
    "UETdA",
    "XTRrg",
    "scrollTop",
    "TvukN",
    "winWidth",
    "HkpxK",
    "YWZVu",
    "rAndRender",
    "oRCPY",
    "cFuXR",
    "mousewheel",
    "xLength",
    "xPncX",
    "KnUwX",
    "xyMMA",
    "DhSKF",
    "UFhGb",
    "kmdRG",
    "mousemove",
    "PojKv",
    "IdJuY",
    "bTvfh",
    "YwPUv",
    "Btbli",
    "UpmwX",
    "KARtn",
    "MaNLm",
    "ASSIt",
    "WAZET",
    "XjasR",
    "handler",
    "LlnTp",
    "KSuTe",
    "rGflm",
    "zXzQT",
    "pFuMM",
    "Keydown",
    "request",
    "SmufM",
    "webglStr",
    "BfafX",
    "JYDff",
    "activityEv",
    "ZqWmg",
    "BGL",
    "zvtwj",
    "rpwLU",
    "irUMs",
    "mACwr",
    "sqrt",
    "default",
    "3|0|1|4|2",
    "jMcFu",
    "fKXji",
    "UNMASKED_R",
    "ENDOR_WEBG",
    "YcCnZ",
    "SneWt",
    "cxGNd",
    "KTYvd",
    "ive must r",
    "sJqUV",
    "uqxAy",
    "VERSION",
    "nwFez",
    "OsTvj",
    "YfGxe",
    "VDhPT",
    "Ocnit",
    "UjgVw",
    "oLIIh",
    "aIBlm",
    "imitive va",
    "Jjufo",
    "TJNHF",
    "JRBEa",
    "poJqO",
    "length",
    "cancel",
    "tector can",
    "axexh",
    "error",
    "HfGLY",
    "mdzfB",
    "QdSxV",
    "BlXjP",
    "hORsa",
    "gUxMt",
    "clientY",
    "Wheel",
    "vpuEw",
    "JDjwl",
    "wPHEK",
    "wJYGs",
    "HlQzk",
    "RCKkU",
    "jeVZD",
    "hbjvN",
    "mLfZa",
    "now",
    "SwzMg",
    "PVzbt",
    "DFqlG",
    "IkFvz",
    "fonEm",
    "HzjVZ",
    "YogpL",
    "oPXWT",
    "endTime",
    "ifhwB",
    "NpIOd",
    "log",
    "SRgXf",
    "@@toPrimit",
    "4|5|0|2|1|",
    "pjcpX",
    "fzkly",
    "knpkv",
    "GfHMw",
    "clientWidt",
    "bBLFA",
    "torAll",
    "DTlXc",
    "getUserWeb",
    "LmMro",
    "body",
    "uACnQ",
    "Focus",
    "forEach",
    "WwDUS",
    "FqJYf",
    "noLeading",
    "7599321iluKbz",
    "UaEbV",
    "uwQKa",
    "listenChan",
    "uZnZd",
    "preTime",
    "iJRwo",
    "keys",
    "pow",
    "oxfnz",
    "GzAwL",
    "eCMBJ",
    "touchstart",
    "PfqSW",
    "webgl",
    "CJyCc",
    "LKatB",
    "EtFlG",
    "PkGom",
    "tCatL",
    "oScJs",
    "lzUPU",
    "FRsnA",
    "lEthQ",
    "call",
    "PRXlB",
    "div[data-v",
    "fingerprin",
    "hiLhD",
    "focus",
    "charCodeAt",
    "TGxcl",
    "res",
    "EdVKP",
    "-risk=\"",
    "QCfRb",
    "kDAiy",
    "mousedown",
    "ETFWm",
    "TpAcl",
    "iPAmB",
    "dKkyy",
    "TMQWu",
    "fiHKc",
    "dTUpU",
    "4|2|0|3|1",
    "snSVA",
    "dWOxN",
    "push",
    "hjXkY",
    "OHzzd",
    "grtBL",
    "HRWpB",
    "eDokE",
    "URKiv",
    "writable",
    "RuTaZ",
    "KpGhZ",
    "hxYAW",
    "yUxVt",
    "NZUpH",
    "DAPlX",
    "xtension",
    "cBElS",
    "documentEl",
    "QxgVD",
    "bslVH",
    "slJTx",
    "ZUSoZ",
    "XtLkL",
    "XtUZR",
    "ROvAr",
    "Cannot cal",
    "CzTNf",
    "OiYQY",
    "AVkyo",
    "LrBpy",
    "WIEjv",
    "QBqTP",
    "autoInit",
    "HEFkP",
    "mLgfg",
    "innerWidth",
    "dADVz",
    "krWWq",
    "lTjIC",
    "ybNrX",
    "getExtensi",
    "kRNsj",
    "logger",
    "PLnTN",
    "activityDe",
    "UNMASKED_V",
    "wItyk",
    "TpeJX",
    "ESSRU",
    "enumerable",
    "dAGzH",
    "yOlbl",
    "Pxwea",
    "6|3",
    "vOweH",
    "kEgzf",
    "irSpe",
    "innerHeigh",
    "AZzJU",
    "GzIty",
    "DOMMouseSc",
    "vuxeE",
    "value",
    "removeEven",
    "fwkpo",
    "cIGGF",
    "buffer",
    "lelJa",
    "getContext",
    "type",
    "KytVZ",
    "iArsP",
    "jmKbv",
    "FwyOL",
    "name",
    "xGZNi",
    "ctionFeatu",
    "NqPDG",
    "PgcsW",
    "getPreTime",
    "dKPqf",
    "samplingTi",
    "toPrimitiv",
    "cxFSo",
    "left",
    "_info",
    "JtnXY",
    "xBWmU",
    "key",
    "otZBg",
    "hKzhb",
    "IIudl",
    "FUtcz",
    "getParamet",
    "toLowerCas",
    "EnzNz",
    "wVlgb",
    "NDVwV",
    "wWNhb",
    "Jdizw",
    "clearLog",
    "4573681VdKRIh",
    "1321645zHscsv",
    "initLogger",
    "kDmQR",
    "lzZuR",
    "aKEVv",
    "Click",
    "webglVendo",
    "sZdXW",
    "MMDqc",
    "JPhiz",
    "OMqbw",
    "uUrMs",
    "boHiY",
    "VXTNv",
    "getLog",
    "yPPxE",
    "canvas",
    "addEventLi",
    "WTTrR",
    "tAuEM",
    "ZyDza",
    "Vdxow",
    "MCnoQ",
    "ObjTb",
    "BLlHW",
    "Qswwb",
    "sPZxm",
    "YnsTz",
    "floor",
    "defineProp",
    "roll",
    "userLogStr",
    "TIbyD",
    "cghDZ",
    "VSWix",
    "ePFZK",
    "Log",
    "AUByt",
    "keydown",
    "pMUxz",
    "ement",
    "EcSjJ",
    "LLtyV",
    "uOPaR",
    "pyPXg",
    "eturn a pr",
    "toString",
    "instance",
    "CfIej",
    "wESuN",
    "IAXLd",
    "Touch",
    "ISFJf",
    "gzlKl",
    "ZzLeG",
    "KTZKq",
    "bafBb",
    "VunXs",
    "scroll",
    "winHeight",
    "OfywN",
    "ENDERER_WE",
    "dXtbn",
    "gZxcu",
    "g can not ",
    "MQeRX",
    "umSsc",
    "className",
    "noTrailing",
    "lYiaq",
    "xjqyT",
    "aUCzf",
    "BEDzc",
    "LLCKt",
    "dhGxT",
    "AVCSB",
    "lue.",
    "params",
    "bAwsg",
    "DpTDG",
    "CIDEK",
    "SJJVa",
    "osPji",
    "mouse",
    "cEGUu",
    "QUCjV",
    "bHWOi",
    "RNWIC",
    "cQrJS",
    "KUeAr",
    "oyRiK",
    "kFGzU",
    "enyTE",
    "l a class ",
    "kZjaw",
    "Move",
    "getBoundin",
    "DCxYn",
    "apply",
    "start",
    "YXQjs",
    "erty",
    "ion",
    "LOG",
    "top",
    "rdJoF",
    "IxcDQ",
    "eCOwI",
    "deltaX",
    "qcPxy",
    "kmxbr",
    "BGwTg",
    "qEyPd",
    "FSLIg",
    "CeXiy",
    "vMEEa",
    "g_renderer",
    "stener",
    "FYriJ",
    "10294552LLSHQN",
    "cmHiz",
    "vioam",
    "mrvpu",
    "dMUZm",
    "configurab",
    "touches",
    "uiebI",
    "scrollLeft",
    "YNwqQ",
    "SsKvW",
    "filter",
    "nce",
    "JfFWx",
    "PSOOK",
    "timestamp",
    "wDExj",
    "reStart",
    "ZIeAd",
    "prototype",
    "ents",
    "yoOmM",
    "symbol",
    "MLDfD",
    "split",
    "KaWjd",
    "deltaY",
    "undefined",
    "1664687GWshsv",
    "tYlXP",
    "4547716YIFvRB",
    "ActivityDe",
    "AeNBv",
    "aCJoV",
    "preEvent",
    "startTime",
    "aFdXN",
    "aLgXo",
    " not be us",
    "1|2|6|4|7|",
    "PnWqZ",
    "38912KEOQou",
    "1|0",
    "debounceMo",
    "coWBu",
    "Mwvoj",
    "RAjhN",
    "object",
    "moCyy",
    "DDSNy",
    "jNvfS",
    "hHBXt",
    "nAxRU",
    "SaDxx",
    "countDista",
    "KKXxi",
    "jKLMk",
    "xJGwh",
    "clientHeig",
    "PMIor",
    "WEBGL_debu",
    "clientX",
    "width",
    "txBMI",
    "click",
    "constructo",
    "kRQjb",
    "dSAvo",
    "lvnDF",
    "wllrk",
    "XqVkD",
    "JEeJx",
    "DpGxc",
    "tInMD",
    "qItVy",
    "no webgl e",
    "CpPgW",
    "mkELl",
    "emtwJ",
    "XhNxs",
    "qhFiF",
    "zhsgF",
    "jdlnI",
    "hJUbm",
    "PNPTx",
    "aJxBK",
    "mgAIo",
    "fromCharCo",
    "Dmfja",
    "LqwSI",
    "tListener",
    "rMQSi",
    "shift",
    "IODGC",
    "JruFE",
    "string",
    "pZibL"
  ]
}

function o2(t, e) {
  var n = F();
  return (o2 = function (t, e) {
    return n[t -= 145]
  }
  )(t, e)
}

const tt = function (t) {
  var e = o2
    , n = {
      MQeRX: function (t, e) {
        return t(e)
      },
      umSsc: function (t, e) {
        return t - e
      }
    }
    , r = (new TextEncoder).encode(t)[e(478)]
    , o = new Uint8Array(r)
    , i = n[e(579)](btoa, String[e(720) + "de"][e(612)](null, o));
  return i.substring(0, n[e(580)](i[e(310)], 2))
}

// dm_img_list:       545 == userLogStr  
// dm_img_str:        272 == webglStr
// dm_cover_img_str:  520 == webglVendo
//                    240 == rAndRender 
//                    er ============== webglVendorAndRenderer

const img = '4a1d4479a1ea4146bc7552eea71c28e9'
const sub = "fa5812e23a204d10b332dc24d992432d"

module.exports = function (params) {

  const paramsData = {
    ...params,
    dm_img_list: JSON.stringify([]),
    dm_img_str: tt("WebGL 1.0 (OpenGL ES 2.0 Chromium)"),
    dm_cover_img_str: tt("ANGLE (Apple, ANGLE Metal Renderer: Apple M1 Pro, Unspecified Version)Google Inc. (Apple)"),
    dm_img_inter: JSON.stringify({ "ds": [{ "t": 0, "c": "", "p": [57, 19, 19], "s": [221, 5663, 4038] }], "wh": [297, 99, 99], "of": [57, 114, 57] })
  }

  const rid = getRid(img, sub, paramsData)

  return {
    ...paramsData,
    ...rid
  }
}

